package dao;

import java.sql.SQLException;
import java.util.List;

import org.springframework.orm.ibatis.SqlMapClientTemplate;

import po.School;
import po.Score;
import po.Subject;
import po.Teacher;
import po.WangdianType;
import po.WangdianZuobiao;

public class SchoolIbatisDao {
	private SqlMapClientTemplate sqlMapClientTemplate;

	  public SqlMapClientTemplate getSqlMapClientTemplate() {
	    return sqlMapClientTemplate;
	  }

	  public void setSqlMapClientTemplate(
	      SqlMapClientTemplate sqlMapClientTemplate) {
	    this.sqlMapClientTemplate = sqlMapClientTemplate;
	  }
	  
	  public List<School> getSchools() throws SQLException{
		  return (List<School>)sqlMapClientTemplate.getSqlMapClient().queryForList("school.selectSchool");
	  }
	  
	  public List<Score> getScore(String sid) throws SQLException{
		  return (List<Score>)sqlMapClientTemplate.getSqlMapClient().queryForList("school.selectScore",sid);
	  }
	  
	  public List<Subject> getSubject(String sid) throws SQLException{
		  return (List<Subject>)sqlMapClientTemplate.getSqlMapClient().queryForList("school.selectSubject",sid);
	  }
	  public List<Teacher> getTeacher(String sid) throws SQLException{
		  return (List<Teacher>)sqlMapClientTemplate.getSqlMapClient().queryForList("school.selectTeacher",sid);
	  }
	  
	  public List<WangdianZuobiao> getWangDian() throws SQLException{
		  return (List<WangdianZuobiao>)sqlMapClientTemplate.getSqlMapClient().queryForList("school.selecWangDian");
	  }
	  
	  public List<WangdianType> getWangDianType() throws SQLException{
		  return (List<WangdianType>)sqlMapClientTemplate.getSqlMapClient().queryForList("school.selecWangDianType");
	  }
	  
}
